# Contributor: Noel Kuntze <noel.kuntze@thermi.consulting>
# Maintainer: Noel Kuntze <noel.kuntze@thermi.consulting>
pkgname=py3-daemon
pkgver=3.0.1
pkgrel=0
pkgdesc="Library to implement a well-behaved Unix daemon process"
url="https://pagure.io/python-daemon"
options="!check" # Has lots of dependencies
arch="noarch"
license="Apache-2.0 AND GPL-3.0-or-later"
depends="py3-setuptools py3-lockfile"
makedepends="
	py3-docutils
	py3-gpep517
	py3-wheel"
subpackages="$pkgname-pyc"
source="
	https://pypi.io/packages/source/p/python-daemon/python-daemon-$pkgver.tar.gz
	remove-docutils-depend.patch
"
builddir="$srcdir/python-daemon-$pkgver"

prepare() {
	default_prepare

	# Remove unnecessary dependency for building, twine is
	# required for uploading the package to pypi which we don't
	# do
	sed -e '/twine/d' -i setup.py
}

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

package() {
	python -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
ea35ec3e930e533ef08a492aa36492a958c9258857cdc75ab2ddb6688a7d8990282cfa0f63ee5cb6b7036b9cb71be03631d5d0d58788a08052425a441bce4e9a  python-daemon-3.0.1.tar.gz
20bc4bce7fba9754d1c9bca298f9b4ff7fe90ecf51769df2020912f370650a5997f91c99c6be2ecffed10a6b359a29b1f64b0c391772451eb3c04769df381015  remove-docutils-depend.patch
"
